/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package mysweethome.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author BKC
 */
@Entity
@Table(name = "DetailPropertyInfo", catalog = "MySweetHomeDB", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "DetailPropertyInfo.findAll", query = "SELECT d FROM DetailPropertyInfo d"),
    @NamedQuery(name = "DetailPropertyInfo.findByPropertyInfoID", query = "SELECT d FROM DetailPropertyInfo d WHERE d.propertyInfoID = :propertyInfoID"),
    @NamedQuery(name = "DetailPropertyInfo.findByHasFurniture", query = "SELECT d FROM DetailPropertyInfo d WHERE d.hasFurniture = :hasFurniture"),
    @NamedQuery(name = "DetailPropertyInfo.findByPageView", query = "SELECT d FROM DetailPropertyInfo d WHERE d.pageView = :pageView"),
    @NamedQuery(name = "DetailPropertyInfo.findByDeposit", query = "SELECT d FROM DetailPropertyInfo d WHERE d.deposit = :deposit"),
    @NamedQuery(name = "DetailPropertyInfo.findByIsFixedPrice", query = "SELECT d FROM DetailPropertyInfo d WHERE d.isFixedPrice = :isFixedPrice"),
    @NamedQuery(name = "DetailPropertyInfo.findByNoOfBathrooms", query = "SELECT d FROM DetailPropertyInfo d WHERE d.noOfBathrooms = :noOfBathrooms"),
    @NamedQuery(name = "DetailPropertyInfo.findByNoOfBedrooms", query = "SELECT d FROM DetailPropertyInfo d WHERE d.noOfBedrooms = :noOfBedrooms"),
    @NamedQuery(name = "DetailPropertyInfo.findByDuration", query = "SELECT d FROM DetailPropertyInfo d WHERE d.duration = :duration"),
    @NamedQuery(name = "DetailPropertyInfo.findByPrice", query = "SELECT d FROM DetailPropertyInfo d WHERE d.price = :price"),
    @NamedQuery(name = "DetailPropertyInfo.findBySubmittedDate", query = "SELECT d FROM DetailPropertyInfo d WHERE d.submittedDate = :submittedDate"),
    @NamedQuery(name = "DetailPropertyInfo.findByRent", query = "SELECT d FROM DetailPropertyInfo d WHERE d.rent = :rent"),
    @NamedQuery(name = "DetailPropertyInfo.findByPaymentMode", query = "SELECT d FROM DetailPropertyInfo d WHERE d.paymentMode = :paymentMode")})
public class DetailPropertyInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PropertyInfoID")
    private Integer propertyInfoID;
    @Column(name = "HasFurniture")
    private Boolean hasFurniture;
    @Lob
    @Column(name = "MoreDetail")
    private String moreDetail;
    @Basic(optional = false)
    @Column(name = "PageView")
    private int pageView;
    @Column(name = "Deposit")
    private BigDecimal deposit;
    @Column(name = "IsFixedPrice")
    private Boolean isFixedPrice;
    @Column(name = "NoOfBathrooms")
    private Integer noOfBathrooms;
    @Column(name = "NoOfBedrooms")
    private Integer noOfBedrooms;
    @Basic(optional = false)
    @Column(name = "Duration")
    private short duration;
    @Lob
    @Column(name = "ExtraFacilitiesAvailable")
    private String extraFacilitiesAvailable;
    @Column(name = "Price")
    private BigDecimal price;
    @Basic(optional = false)
    @Column(name = "SubmittedDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date submittedDate;
    @Column(name = "Rent")
    private BigDecimal rent;
    @Lob
    @Column(name = "TransportMode")
    private String transportMode;
    @Basic(optional = false)
    @Column(name = "PaymentMode")
    private String paymentMode;
    @JoinColumn(name = "PropertyInfoID", referencedColumnName = "PropertyInfoID", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private GeneralInfo generalInfo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "detailPropertyInfo")
    private List<PropertyImage> propertyImageList;

    public DetailPropertyInfo() {
    }

    public DetailPropertyInfo(Integer propertyInfoID) {
        this.propertyInfoID = propertyInfoID;
    }

    public DetailPropertyInfo(Integer propertyInfoID, int pageView, short duration, Date submittedDate, String paymentMode) {
        this.propertyInfoID = propertyInfoID;
        this.pageView = pageView;
        this.duration = duration;
        this.submittedDate = submittedDate;
        this.paymentMode = paymentMode;
    }

    public Integer getPropertyInfoID() {
        return propertyInfoID;
    }

    public void setPropertyInfoID(Integer propertyInfoID) {
        this.propertyInfoID = propertyInfoID;
    }

    public Boolean getHasFurniture() {
        return hasFurniture;
    }

    public void setHasFurniture(Boolean hasFurniture) {
        this.hasFurniture = hasFurniture;
    }

    public String getMoreDetail() {
        return moreDetail;
    }

    public void setMoreDetail(String moreDetail) {
        this.moreDetail = moreDetail;
    }

    public int getPageView() {
        return pageView;
    }

    public void setPageView(int pageView) {
        this.pageView = pageView;
    }

    public BigDecimal getDeposit() {
        return deposit;
    }

    public void setDeposit(BigDecimal deposit) {
        this.deposit = deposit;
    }

    public Boolean getIsFixedPrice() {
        return isFixedPrice;
    }

    public void setIsFixedPrice(Boolean isFixedPrice) {
        this.isFixedPrice = isFixedPrice;
    }

    public Integer getNoOfBathrooms() {
        return noOfBathrooms;
    }

    public void setNoOfBathrooms(Integer noOfBathrooms) {
        this.noOfBathrooms = noOfBathrooms;
    }

    public Integer getNoOfBedrooms() {
        return noOfBedrooms;
    }

    public void setNoOfBedrooms(Integer noOfBedrooms) {
        this.noOfBedrooms = noOfBedrooms;
    }

    public short getDuration() {
        return duration;
    }

    public void setDuration(short duration) {
        this.duration = duration;
    }

    public String getExtraFacilitiesAvailable() {
        return extraFacilitiesAvailable;
    }

    public void setExtraFacilitiesAvailable(String extraFacilitiesAvailable) {
        this.extraFacilitiesAvailable = extraFacilitiesAvailable;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Date getSubmittedDate() {
        return submittedDate;
    }

    public void setSubmittedDate(Date submittedDate) {
        this.submittedDate = submittedDate;
    }

    public BigDecimal getRent() {
        return rent;
    }

    public void setRent(BigDecimal rent) {
        this.rent = rent;
    }

    public String getTransportMode() {
        return transportMode;
    }

    public void setTransportMode(String transportMode) {
        this.transportMode = transportMode;
    }

    public String getPaymentMode() {
        return paymentMode;
    }

    public void setPaymentMode(String paymentMode) {
        this.paymentMode = paymentMode;
    }

    public GeneralInfo getGeneralInfo() {
        return generalInfo;
    }

    public void setGeneralInfo(GeneralInfo generalInfo) {
        this.generalInfo = generalInfo;
    }

    public List<PropertyImage> getPropertyImageList() {
        return propertyImageList;
    }

    public void setPropertyImageList(List<PropertyImage> propertyImageList) {
        this.propertyImageList = propertyImageList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (propertyInfoID != null ? propertyInfoID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetailPropertyInfo)) {
            return false;
        }
        DetailPropertyInfo other = (DetailPropertyInfo) object;
        if ((this.propertyInfoID == null && other.propertyInfoID != null) || (this.propertyInfoID != null && !this.propertyInfoID.equals(other.propertyInfoID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mysweethome.entities.DetailPropertyInfo[propertyInfoID=" + propertyInfoID + "]";
    }

}
